/**
 *
 * @authors Your Name (you@example.org)
 * @date    2018-04-19 17:08:35
 * @version $Id$
 */
var urlStr = 'http://mg.aidikou.cn/'
$.ajaxSetup({
  timeout: 15 * 1000,
  xhrFields: {
    withCredentials: true
  },
  error: function () {}
})

function addrecorduservisit() {
  $.get(urlStr + '/addrecorduservisit.cspx', {
      pageurl: window.location.href
    },
    function (res) {});
}

function logonout() {
  $.get(urlStr + '/logonout.cspx', function (res) {
    var json = $.parseJSON(res);
    if (json.Success) {
      layer.open({
        content: '退出成功',
        btn: '好的',
        yes: function (index) {
          layer.close(index)
          window.location.reload()
          delCookie('accounts', getCookie('accounts'))
        }
      });
    }
  });
}

$(function () {
  addrecorduservisit();
  checkCookie();
});
